#!/bin/bash
# 一键编译脚本

# 设置环境
export PATH=/c/msys64/ucrt64/bin:$PATH
export PKG_CONFIG_PATH=/c/msys64/ucrt64/lib/pkgconfig

echo "编译 cbp2make_ai_unified..."
echo "当前目录: $(pwd)"
echo "文件列表:"
ls -la *.cpp *.h 2>/dev/null
echo

# 编译
g++ -std=c++11 -O2 -Wall -Wextra \
    $(pkg-config --cflags wxwidgets) \
    main_unified.cpp workspace_parser.cpp \
    $(pkg-config --libs wxwidgets) \
    -o cbp2make_ai.exe

if [ $? -eq 0 ]; then
    echo "✅ 编译完成: cbp2make_ai.exe"
    ./cbp2make_ai.exe --version
else
    echo "❌ 编译失败"
    exit 1
fi
